home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.hut.fi!usenet
- From: oahvenla@hyppynaru.cs.hut.fi (Osma Ahvenlampi)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Messages vs. Semaphores for external clocking
- Date: 04 Apr 1996 19:30:04 +0300
- Organization: What, me, organised?
- Sender: oahvenla@hyppynaru.cs.hut.fi
- Distribution: inet
- Message-ID: <jdj7mvw6jg3.fsf@hyppynaru.cs.hut.fi>
- References: <4ju349$r1e@sparky.navsea.navy.mil>
- NNTP-Posting-Host: hyppynaru.cs.hut.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- In-reply-to: matuli_a@marlin.navsea.navy.mil's message of 3 Apr 1996 14:48:41
- GMT
- X-Newsreader: Gnus v5.1
-
- In article <4ju349$r1e@sparky.navsea.navy.mil> matuli_a@marlin.navsea.navy.mil (Alex Matulich 03T1 602-6691) writes:
- >I am wondering what is the most efficient way for one task to make data
- >available to another task. I can do this by passing messages, or by
- >setting up a semaphore to provide a common area of memory accessible by
- >both tasks.
-
- For Exec, both methods are very fast. Just try it yourself, make a
- loop that sends messages between two tasks, and on the other hand try
- looping on ObtainSemaphore()/ReleaseSemaphore().
-
- So, the choice of which to use shouldn't be a question of
- performance. Choose whichever suits your problem better. In your
- specific case, it would seem that using a semaphore protected, perhaps
- double buffered shared data region and signaling the other task every
- time new data is available might work well. You can set up semaphores
- to even do the signaling.
-
- --
- Wynne`s Law: Negative slack tends to increase.
- | "Osma Ahvenlampi" <mailto:oa@iki.fi> <http://www.iki.fi/oa/> |
- | Amiga&BeBox&ClassAct&Voodoo&ARTech cool stuff: I-Net225&AWeb |
- --
-